package com.seecen.controller;

import com.seecen.service.HelpService;
import com.seecen.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: SharkBookkeeping-end
 * @description:
 * @author: XXW
 * @create: 2025-10-17 21:22
 * @version: 1.0
 **/
@RestController
@RequestMapping("/help")
@CrossOrigin
@Slf4j
public class HelpController {

    @Autowired
    private HelpService helpService;

    /**
     * 获取所有帮助文档列表
     * @return 帮助文档列表
     */
    @GetMapping("/list")
    public Result getHelpList() {
        Result ret = helpService.getHelpList();
        log.info("getHelpList ret ====> {}", ret);
        return ret;
    }

    /**
     * 根据ID获取帮助文档详情
     * @param id 帮助文档ID
     * @return 帮助文档详情
     */
    @GetMapping("/{id}")
    public Result getHelpById(@PathVariable Long id) {
        Result ret = helpService.getHelpById(id);
        log.info("getHelpById ret ====> {}", ret);
        return ret;
    }
}